﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace Wicresoft.RDW.Interface
{
    public interface IObject<T>
    {
        T GetById(int id);

        T GetByCondition(Expression<Func<T, bool>> condition);

        List<T> GetList();

        List<T> GetList(Expression<Func<T, bool>> condition);

        PagedList<T> GetPaged(int pageIndex, int pageSize);

        PagedList<T> GetPaged(int pageIndex, int pageSize, Expression<Func<T, bool>> expression);

        PagedList<T> GetPaged<TKey>(int pageIndex, int pageSize, Expression<Func<T, bool>> expression, Expression<Func<T, TKey>> orderBy, bool isDesc);

        PagedList<T> GetPaged<TKey>(int pageIndex, int pageSize, Expression<Func<T, TKey>> orderBy, bool isDesc);

        PagedList<T> GetPaged(List<T> qry, int count, int pageIndex, int pageSize);

        void Create(T t);

        void Update(T t);

        void Delete(T t);

        void Delete(List<T> ts);
    }
}
